package com.ex.cc;
 
import java.io.IOException;
import java.util.StringTokenizer;
import org.apache.hadoop.io.IntWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Mapper;
public class MapperClass  extends Mapper<Object, Text, Text, IntWritable> {
	IntWritable one = new IntWritable(1);
	Text word = new Text();
	int i = 1;

	public void map(Object key, Text value, Context context) throws IOException,InterruptedException {
		System.out.printf("\nMapperClass %s",i);
		i ++;
		StringTokenizer itr = new StringTokenizer(value.toString());
		while(itr.hasMoreTokens()) {
			System.out.printf("  |- ");
			System.out.print(one);
			System.out.printf(" - ");
			word.set(itr.nextToken());
			System.out.print(word);
			context.write(word, one);
		}
	}
}